# -*- coding: utf-8 -*-
# @Author: garlic
# @Date:   2019-04-08 16:05:58
# @Last Modified by:   garlic
# @Last Modified time: 2019-04-08 16:05:58

import const
import logging
import sdk
import requests

##查询接口
def pay_create():
    __map = {}
    __map["app_id"] = const.GF_APPID
    __map["timestamp"] = sdk.getNow()
    __map["version"] = const.API_VERSION
    __map["store_code"] = const.STORE_CODE
    __map["pay_channel"] ="WECHAT"
    __map["oper_id"] =""
    __map["amount"] =1
    __map["undiscountable_amount"] =0
    __map["raw_data"] =""
    __map["down_trade_no"] = sdk.genTradeNo()
    __map["subject"] = "广分测试门店"
    __map["back_notify_url"] = "http://www.baidu.com/"
    __map["sub_appid"] = "wx73d8e0639250e7b9"
    __map["sub_appid_type"] = "MINI_PROGRAM"
    __map["sub_open_id"] = "owKfi5N05gCtpUiTNpIbizKCtCfk"
    __map["sign"] = sdk.doSign(__map)

    # 请求
    response = requests.post(const.GF_API_URL_PREFIX + const.API_VERSION  + "/pay/create", params=__map)

    logging.info(response.text)